import request from '@/utils/request';
import { other } from './prefix';

const artisManage = {
  // 查询艺术家列表
  getArtis(params) {
    return request.get(other + '/art', { params });
  },
  // 查询艺术家详情
  getOneArtis(id) {
    return request.get(other + '/art/' + id);
  },
  // 查询艺术家列表
  getRecommentArtis(params) {
    return request.get(other + '/art_recomment', { params });
  },
  // 移动推荐艺术家列表
  moveRecomment(id, type) {
    return request.post(other + '/art_recomment/' + id + '?op=' + type, {});
  },
  // 创建艺术家
  setArtis(params) {
    return request.post(other + '/art', params);
  },
  // 更新艺术家
  updArtis(id, params) {
    return request.post(other + '/art/' + id, params);
  },
  // 删除艺术家
  delArtis(id) {
    return request.delete(other + '/art/' + id);
  },
  // 上传艺术家图片
  setArtisImage(id, params) {
    return request.post(other + '/art/' + id + '?op=upload_file&name=photo', params);
  },
  getVideos(params) {
    return request.get(other + '/art_video', { params });
  },
  createVideos(params) {
    return request.post(other + '/art_video', params);
  },
  UpdVideos(id, params) {
    return request.post(other + '/art_video/' + id, params);
  },
  uploadVideosImg(id, params) {
    return request.post(other + '/art_video/' + id + '?op=upload_file&name=video_page', params);
  },
  uploadVideo(id, params) {
    return request.post(other + '/art_video/' + id + '?op=upload_file&name=video_path', params);
  },
  getVideoInfo(id) {
    return request.get(other + '/art_video/' + id);
  },
  delVideo(id) {
    return request.delete(other + '/art_video/' + id);
  },
  download(id) {
    return request.get(other + '/art_video/' + id + '?op=download_file&name=video_page', { responseType: 'blob' });
  },
  downloadVideo(path) {
    return request.get(other + '/art_video_path/' + path, { responseType: 'blob' });
  },
};

export default artisManage;
